<template>
    <div class="login-container">
      <div class="login-box">
        <h2>欢迎登录</h2>
        <p>Welcome to login</p>
        <el-form :model="loginForm" ref="loginForm" label-width="100px" class="login-form">
          <el-form-item label="手机号" prop="phone">
            <el-input v-model="loginForm.phone" placeholder="请输入手机号"></el-input>
          </el-form-item>
          <el-form-item label="验证码" prop="code">
            <el-input v-model="loginForm.code" placeholder="请输入验证码"></el-input>
            <el-button type="text" @click="getVerificationCode">获取验证码</el-button>
          </el-form-item>
          <el-form-item>
            <el-button type="danger" class="login-button" @click="handleLogin">立即登录</el-button>
          </el-form-item>
        </el-form>
      </div>
    </div>
  </template>
  
  <script>
  export default {
    data() {
      return {
        loginForm: {
          phone: '',
          code: ''
        }
      }
    },
    methods: {
    getVerificationCode() {
        // 这里添加获取验证码的逻辑
        console.log('获取验证码')
    },
    handleLogin() {
          // 这里添加登录逻辑
        console.log('登录', this.loginForm)
    }
    }
}
  </script>
  
  <style scoped>
  .login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff; /* 设置为白色背景 */
  }
  
  .login-box {
    background-color: rgba(255, 255, 255, 0.8); /* 背景颜色和透明度 */
    padding: 40px 80px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  
  .login-form {
    margin-top: 20px;
  }
  
  .login-button {
    width: 100%;
    background-color: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    padding: 10px 20px;
  }
  </style>